package com.unknowpupil.web.component.wallet.service;

import com.unknowpupil.web.component.wallet.entity.CoinWallet;
import com.unknowpupil.web.domain.BlockHeight;
import com.unknowpupil.web.exception.MxException;

/**
 * @Classname: CoinToolsService
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2019/10/18 14:35
 * @Description:
 * @Version: 1.0
 */
public interface CoinToolsService {

    /**
     * 初始化配置
     * @throws Exception
     */
    void init() throws Exception;

    /**
     * 获取余额
     * @param address
     * @return
     * @throws Exception
     */
    double getBalance(String address) throws Exception;

    /**
     * 创建钱包
     * @param password
     * @return
     * @throws Exception
     */
    CoinWallet createWallet(String password) throws MxException;

    /**
     * 更具资源读取私钥公钥
     * @param source
     * @return
     */
    CoinWallet readWalletBySource(String password ,String source) throws MxException;

    /**
     * 获取区块高度
     * @return
     * @throws Exception
     */
    int getBlockHeight() throws Exception;

    /**
     * 根据区块高度处理区块信息
     * @param height
     * @return
     * @throws Exception
     */
    boolean parseBlock(long height) throws Exception;

    /**
     * 处理交易信息
     * @param object
     * @throws Exception
     */
    void parserTransactionInfo(Object object) throws Exception;



      }
